load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "model",
    srcs = [
        "bdr.go",
        "column.go",
        "db.go",
        "flags.go",
        "index.go",
        "job.go",
        "job_args.go",
        "placement.go",
        "reorg.go",
        "resource_group.go",
        "table.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/meta/model",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config/kerneltype",
        "//pkg/parser/ast",
        "//pkg/parser/auth",
        "//pkg/parser/charset",
        "//pkg/parser/duration",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/parser/types",
        "//pkg/planner/cascades/base",
        "//pkg/sessionctx/vardef",
        "//pkg/util/intest",
        "//pkg/util/tracing",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_tikv_pd_client//http",
        "@org_uber_go_atomic//:atomic",
    ],
)

go_test(
    name = "model_test",
    timeout = "short",
    srcs = [
        "bdr_test.go",
        "column_test.go",
        "index_test.go",
        "job_args_test.go",
        "job_test.go",
        "placement_test.go",
        "table_test.go",
    ],
    embed = [":model"],
    flaky = True,
    shard_count = 50,
    deps = [
        "//pkg/config/kerneltype",
        "//pkg/parser/ast",
        "//pkg/parser/charset",
        "//pkg/parser/duration",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/parser/types",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_pd_client//http",
    ],
)
